//
//  LDHomeHeadView.m
//  LuDaoJinFu
//
//  Created by dzjf on 2017/3/1.
//  Copyright © 2017年 dzjf. All rights reserved.
//

#import "LDHomeHeadView.h"

@implementation LDHomeHeadView

- (void)awakeFromNib {
    [super awakeFromNib];
    self.scrollView.userInteractionEnabled = YES;
    self.scroller = [[SDCycleScrollView alloc] init];
    CGFloat height = SCREEN_WIDTH * 0.48;
    self.scroller.frame = CGRectMake(0, 0, SCREEN_WIDTH, height);
    self.scroller.contentMode = UIViewContentModeScaleAspectFit;
    self.scroller.showPageControl = NO;
    self.scroller.backgroundColor = [UIColor whiteColor];
    [self.scrollView addSubview:self.scroller];
    
    self.pageControll.layer.cornerRadius = 2;
    self.pageControll.clipsToBounds = YES;
    self.page.layer.cornerRadius = 2;
    self.pageControll.hidden = YES;
    self.page.frame = CGRectMake(0, 0, 0, 4);
    
    
    
    self.titleScroll = [[SDCycleScrollView alloc] init];
    self.titleScroll.frame = self.titleView.bounds;
    [self.titleView addSubview:self.titleScroll];
    self.titleScroll.showPageControl = NO;
    self.titleScroll.onlyDisplayText = YES;
    self.titleScroll.autoScrollTimeInterval = 5;
    self.titleScroll.backgroundColor = [UIColor whiteColor];
    self.titleScroll.scrollDirection = UICollectionViewScrollDirectionVertical;
    self.titleScroll.titleLabelBackgroundColor = [UIColor whiteColor];
    self.titleScroll.titleLabelTextColor = DEFAULTCOLOR;
}

- (void)scrollToIndex:(NSInteger)index {
    CGFloat allCount = self.pageControll.frame.size.width / self.scroller.imageURLStringsGroup.count;
    CGRect rect = self.page.frame;
    rect.size.width = allCount;
    rect.origin.x = allCount * index;
    self.page.frame = rect;
}



/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end

@implementation DZHomeAdverModel
@end
@implementation DZHomeBulletinModel
@end
